package cn.wolfcode.enums;

import lombok.Getter;

/**
 * @author JMJ
 * @date 2021/1/14 17:18
 */
@Getter
public enum ActivityTypeEnum {
    SINGLE("单选", 0),
    MULTI("多选", 1);


    private String name;
    private Integer value;

    private ActivityTypeEnum(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    public static String findName(Integer value) {
        //获取所有实例
        ActivityTypeEnum[] enums = values();
        for (ActivityTypeEnum anEnum : enums) {
            if (anEnum.value.equals(value)) {
                return anEnum.name;
            }
        }
        return null;
    }

    }
